package com.example.day07;

public class StringPlusDemo {

    public static void main(String[] args) {
        plus();

        plus1();
    }

    public  static  void plus(){
        long begin = System.currentTimeMillis();
        String ss="";
        for(int i=0;i<100000;i++){
            ss+=i;
        }

        System.out.println("String: "+(System.currentTimeMillis()-begin));
    }

    public  static  void plus1(){
        long begin = System.currentTimeMillis();
       StringBuilder ss=new StringBuilder();
        for(int i=0;i<100000;i++){
           ss.append(i);
        }

        System.out.println("String: "+(System.currentTimeMillis()-begin));
    }
}
